//
//  DmUtil.h
//  FoxitApp
//
//  Created by sijia_liu on 15/5/14.
//
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import <FxkpMRSDK/FSPDFObjC.h>

@class FSRectF;


/**
 * @name Macro Definitions for icon type.
 */
/**@{*/
/** @brief note icon type Check. */
#define FPDF_ICONTYPE_NOTE_CHECK		0
/** @brief note icon type Circle. */
#define FPDF_ICONTYPE_NOTE_CIRCLE			1
/** @brief note icon type Comment. */
#define FPDF_ICONTYPE_NOTE_COMMENT			2
/** @brief note icon type Cross. */
#define FPDF_ICONTYPE_NOTE_CROSS			3
/** @brief note icon type Help. */
#define FPDF_ICONTYPE_NOTE_HELP				4
/** @brief note icon type Insert. */
#define FPDF_ICONTYPE_NOTE_INSERT			5
/** @brief note icon type Key. */
#define FPDF_ICONTYPE_NOTE_KEY				6
/** @brief note icon type New Paragraph. */
#define FPDF_ICONTYPE_NOTE_NEWPARAGRAPH		7
/** @brief note icon type Note. */
#define FPDF_ICONTYPE_NOTE_NOTE				8
/** @brief note icon type Paragraph. */
#define FPDF_ICONTYPE_NOTE_PARAGRAPH		9
/** @brief note icon type Right Arrow. */
#define FPDF_ICONTYPE_NOTE_RIGHTARROW		10
/** @brief note icon type Right Pointer. */
#define FPDF_ICONTYPE_NOTE_RIGHTPOINTER		11
/** @brief note icon type Star. */
#define FPDF_ICONTYPE_NOTE_STAR				12
/** @brief note icon type Up Arrow. */
#define FPDF_ICONTYPE_NOTE_UPARROW			13
/** @brief note icon type Upleft Arrow. */
#define FPDF_ICONTYPE_NOTE_UPLEFTARROW		14

/** @brief file attachment icon type Graph. */
#define FPDF_ICONTYPE_FILEATTACH_GRAPH		0
/** @brief file attachment icon type PaperClip. */
#define FPDF_ICONTYPE_FILEATTACH_PAPERCLIP	1
/** @brief file attachment icon type PushPin. */
#define FPDF_ICONTYPE_FILEATTACH_PUSHPIN    2
/** @brief file attachment icon type Tag. */
#define FPDF_ICONTYPE_FILEATTACH_TAG		3

/** @brief Unknown icon type. */
#define FPDF_ICONTYPE_UNKNOWN				-1
/**@}*/

/// 种类新增： - -By lisa 2022.04.06
/** @brief file attachment icon type Video. */
#define FPDF_ICONTYPE_FILEATTACH_VIDEO     4
/** @brief file attachment icon type Music. */
#define FPDF_ICONTYPE_FILEATTACH_MUSIC     5
/** @brief file attachment icon type PDF. */
#define FPDF_ICONTYPE_FILEATTACH_PDF       6
/** @brief file attachment icon type OFD. */
#define FPDF_ICONTYPE_FILEATTACH_OFD       7
/** @brief file attachment icon type Txt. */
#define FPDF_ICONTYPE_FILEATTACH_TXT       8
/** @brief file attachment icon type Word. */
#define FPDF_ICONTYPE_FILEATTACH_WORD      9
/** @brief file attachment icon type Excel. */
#define FPDF_ICONTYPE_FILEATTACH_EXCEL     10
/** @brief file attachment icon type PPT. */
#define FPDF_ICONTYPE_FILEATTACH_PPT       11
/** @brief file attachment icon type Image. */
#define FPDF_ICONTYPE_FILEATTACH_IMAGE     12
/** @brief file attachment icon type Html. */
#define FPDF_ICONTYPE_FILEATTACH_HTML      13
/** @brief file attachment icon type 3D. */
#define FPDF_ICONTYPE_FILEATTACH_3D        14
/** @brief file attachment icon type Zip. */
#define FPDF_ICONTYPE_FILEATTACH_ZIP       15
/** @brief file attachment icon type 根据文件自动识别. */
#define FPDF_ICONTYPE_FILEATTACH_Auto      16





@interface DmUtil : NSObject

/// DOC
/** @brief Convert bitmap buffer to UImage. */
+ (UIImage*)dib2img:(void*)pBuf size:(int)size dibWidth:(int)dibWidth dibHeight:(int)dibHeight withAlpha:(BOOL)withAlpha;
/** @brief Compare the two rect. */
+ (BOOL)rectEqualToRect:(FSRectF *)rect rect:(FSRectF *)rect1;
+ (BOOL)pointEqualToRect:(FSPointF*)point point:(FSPointF*)point1;


+ (CGRect)FSRectF2CGRect:(FSRectF *)fsrect;
+ (FSRectF *)CGRect2FSRectF:(CGRect)rect;
+ (CGPoint)convert2CGPoint:(FSPointF*)point;
+ (FSPointF*)convert2Point:(CGPoint)point;

+ (NSDate*)convertFSDateTime2NSDate:(FSDateTime *)time;
+ (FSDateTime *)convert2FSDateTime:(NSDate*)date;

+ (NSString*)convert2AppFontString:(NSString*)str;

+ (int)convertNewIconType2Old:(NSString*)newType;
+ (NSString*)convertOldIconType2New:(int)oldType isNote:(BOOL)isNote;

+ (int)convertStampIconString2Int:(NSString*)icon;
+ (NSString*)convertStampIconIndex2String:(int)index;

+ (UIEdgeInsets)convertCGRect2Insets:(CGRect)rect size:(CGSize)size;
+ (CGRect)convertInsets2CGRect:(UIEdgeInsets)insets size:(CGSize)size;
+ (CGRect)convertCGRectWithMargin:(CGRect)rect size:(CGSize)size margin:(int)margin;

+ (BOOL)isReviewDoc:(NSString*)filePath;

+ (CGRect)convertUnionPoint:(CGRect)rect point:(CGPoint)point;

@end
